package com.swanclouds.redfish.managers.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.redfish.common.redfish.Status;
import com.swanclouds.model.managers.EthernetInterfaces;
import com.swanclouds.model.managers.builder.BMC.UpdateEthernetInterfacesBuilder;
import com.swanclouds.redfish.common.redfish.Addresses;
import java.util.List;
import java.util.Map;
/**
 * @author 李文强
 * description iBMC网口资源实体类
 */
public class EthernetInterfacesModel implements EthernetInterfaces {

    //指定iBMC网口资源节点的访问路径
    @JsonProperty("@odata.id")
    private String dataId;

    //指定iBMC网口资源模型的OData描述信息
    @JsonProperty("@odata.context")
    private String context;

    //指定iBMC网口资源类型
    @JsonProperty("@odata.type")
    private String type;

    //指定iBMC网口资源的ID
    @JsonProperty("Id")
    private String id;

    //指定iBMC网口资源的名称
    @JsonProperty("Name")
    private String name;

    //指定BMC网口的不变的MAC地址
    @JsonProperty("PermanentMACAddress")
    private String permanentMACAddress;

    //指定BMC网口的MAC地址
    @JsonProperty("MACAddress")
    private String macaddress;

    //指定BMC网口的状态信息
    @JsonProperty("Status")
    private List<Status> status;

    //自定义资源属性
    @JsonProperty("Oem")
    private Map<String,Object> oem;

    //指定iBMC的主机名
    @JsonProperty("HostName")
    private String hostName;

    //指定iBMC的全称域名
    @JsonProperty("FQDN")
    private String fqdn;

    /**
     * 接口使能，表示接口是否可用。包括：
     * true  接口已启用
     * false  接口未启用
     */
    @JsonProperty("InterfaceEnabled")
    private Boolean interfaceEnabled;

    //指定BMC管理网口的速率
    @JsonProperty("SpeedMbps")
    private Integer speedMbps;

    /**
     * 自动协商模式，表示速率和复用是自动协商的。包括：
     * true
     * false
     */
    @JsonProperty("AutoNeg")
    private Boolean autoNeg;

    /**
     * 全双工模式包含:
     * true
     * false
     */
    @JsonProperty("FullDuplex")
    private Boolean fullDuplex;

    //最大传输单元大小，范围1280到1500
    @JsonProperty("MTUSize")
    private Integer mtuSize;

    /**
     * 网口链路状态包括：
     * LinkDown  物理上连接但未启用
     * LinkUp  物理上连接并启用
     * NoLink  物理上未连接
     */
    @JsonProperty("LinkStatus")
    private String linkStatus;

    //最大的IPV6静态地址的个数
    @JsonProperty("MaxIPv6StaticAddresses")
    private Integer maxIPv6StaticAddresses;

    //指定BMC网口的IPv6网关地址
    @JsonProperty("IPv6DefaultGateway")
    private String iPv6DefaultGateway;

    /**
     * 指定iBMC网口的VLAN信息
     * 仅“固定设置”模式下选择“专用网口”时，不支持VLAN
     * 设置。其他模式下，支持使能和配置VLAN ID
     * 2. 若选择“专用网口”作为iBMC管理网口，当前配置的
     * VLAN信息不生效；若选择了除“专用网口”外的其他网口
     * 作为iBMC管理网口，则当前配置的VLAN信息有效
     */
    @JsonProperty("VLAN")
    private Map<String,Object> vlan;

    //指定BMC网口的DHCPv6配置信息
    @JsonProperty("DHCPv6")
    private Map<String,Object> dHCPv6;

    //指定BMC网口的DHCPv4配置信息
    @JsonProperty("DHCPv4")
    private Map<String,Object> dHCPv4;

    //无状态地址自动配置
    @JsonProperty("StatelessAddressAutoConfig")
    private Map<String,Object> statelessAddressAutoConfig;

    //指定BMC网口的IPv4信息
    @JsonProperty("IPv4Addresses")
    private List<Addresses> iPv4Addresses;

    //指定iBMC网口的IPv6信息
    @JsonProperty("IPv6Addresses")
    private List<Addresses> iPv6Addresses;
    //网口关联资源
    @JsonProperty("Link")
    private Map<String,Object> link;

    public String getDataId() {
        return this.dataId;
    }

    public String getContext() {
        return this.context;
    }

    public String getType() {
        return this.type;
    }

    public String getId() {
        return this.id;
    }

    public String getName() {
        return this.name;
    }

    @Override
    public String getPermanentMACAddress() {
        return this.permanentMACAddress;
    }

    public String getMacaddress() {
        return macaddress;
    }

    public List<Status> getStatus() {
        return status;
    }

    public Map<String,Object> getOem() {
        return oem;
    }

    @Override
    public String getHostName() {
        return hostName;
    }

    public String getFQDN() {
        return fqdn;
    }

    public Boolean getInterfaceEnabled() {
        return interfaceEnabled;
    }

    public Integer getSpeedMbps() {
        return speedMbps;
    }

    public Boolean getAutoNeg() {
        return autoNeg;
    }

    public Boolean getFullDuplex() {
        return fullDuplex;
    }

    public Integer getMtuSize() {
        return mtuSize;
    }

    public String getLinkStatus() {
        return linkStatus;
    }

    public Integer getMaxIPv6StaticAddresses() {
        return maxIPv6StaticAddresses;
    }

    public String getiPv6DefaultGateway() {
        return iPv6DefaultGateway;
    }

    public Map<String, Object> getVlan() {
        return vlan;
    }

    public Map<String, Object> getdHCPv6() {
        return dHCPv6;
    }

    public Map<String, Object> getdHCPv4() {
        return dHCPv4;
    }

    public Map<String, Object> getStatelessAddressAutoConfig() {
        return statelessAddressAutoConfig;
    }

    public List<Addresses> getiPv4Addresses() {
        return iPv4Addresses;
    }

    public Map<String, Object> getLink() {
        return link;
    }

    @Override
    public String getIPv6DefaultGateway() {
        return iPv6DefaultGateway;
    }

    @Override
    public Map<String, Object> getDHCPv6() {
        return dHCPv6;
    }

    @Override
    public Map<String, Object> getDHCPv4() {
        return dHCPv4;
    }

    @Override
    public List<Addresses> getIPv6Addresses() {
        return iPv6Addresses;
    }

    public static UpdateEthernetInterfacesBuilder builder() {
       return null;
    }
    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "EthernetInterfacesModel{" +
                "dataId='" + dataId + '\'' +
                ", context='" + context + '\'' +
                ", type='" + type + '\'' +
                ", id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", permanentMACAddress='" + permanentMACAddress + '\'' +
                ", macaddress='" + macaddress + '\'' +
                ", status=" + status +
                ", oem=" + oem +
                ", hostName='" + hostName + '\'' +
                ", fqdn='" + fqdn + '\'' +
                ", interfaceEnabled='" + interfaceEnabled + '\'' +
                ", speedMbps='" + speedMbps + '\'' +
                ", autoNeg='" + autoNeg + '\'' +
                ", fullDuplex='" + fullDuplex + '\'' +
                ", mtuSize='" + mtuSize + '\'' +
                ", linkStatus='" + linkStatus + '\'' +
                ", maxIPv6StaticAddresses='" + maxIPv6StaticAddresses + '\'' +
                ", iPv6DefaultGateway='" + iPv6DefaultGateway + '\'' +
                ", vlan=" + vlan +
                ", dHCPv6=" + dHCPv6 +
                ", dHCPv4=" + dHCPv4 +
                ", statelessAddressAutoConfig=" + statelessAddressAutoConfig +
                ", iPv4Addresses=" + iPv4Addresses +
                ", iPv6Addresses=" + iPv6Addresses +
                '}';
    }
}
